package com.panshi.service;

import com.panshi.api.util.PageSizeVO;
import com.panshi.bean.*;

import javax.mail.MessagingException;
import java.util.List;

public interface AnswerService {
    public int initAnswer(AnswerNoBean ansNo);//用户回答某个问题

    public int updateQa(int qid);//删除问题表问题
    public int updateQaAnswerNo(int aid);//删除答案审核表的回答
    public int updateQaAnswer(int aid);//删除答案表的问题
    public int updateQaAnswerCom(int aid);//删除该答案下的所有评论
    public int updateQaAnswerLike(int aid);//删除该答案下的所有点赞
    public int deleteAnswerCount(int uid);//该用户的回答总数-1
    public int deleteAnswerDynamic(int yewu_id);//删除动态表数据

    public List<AnswerComBean> openCom(int aid,int pid);//用户点击某个回答打开回复

    public int updateAnswer(AnswerBean2 answer);//用户修改回答
    public int updateAnswerNo(AnswerBean2 answer);//用户修改未审核表回答



    public AnswerLikeBean findLike(int aaid,int uid);//查询用户该回答是否点赞或踩过
    public int  clientLike(int aaid,int uid);//用户给回答点赞
    public int  clientNo(int aaid,int uid);//用户给回答点踩
    public AnswerBean2 findAnswerLikeNo(int aaid, int uid);//返回点赞和点踩数
    public int  addLike(int aaid);//回答表点赞+1
    public int  addNo(int aaid);//回答表点踩+1


    public IssBean FindbyQid(int qid);//根据问题查找问题
    public AnswerBean2 findbyAid(int aid);//根据回答id查询回答信息
    public AnswerNoBean  findbyAidNo(int aaid);//根据回答id查询回答信息(审核表)


    //管理员接口==========================================================================================================
    public List<AnswerBean2> adminFindAnswer(PageSizeVO pageSizeVO);//管理员查询回答表
    public List<AnswerNoBean> adminFindAnswerNo(PageSizeVO pageSizeVO);//管理员查询回答审核表

    public int adminFindAnswerSum(int state);//管理员查询回答表总记录数
    public int adminFindAnswerNoSum(int state);//管理员查询回答审核表总记录数

    public int adminUpdateQaAnswer(int state,int aaid);//管理员修改回答表

    public int addQaInstation(AnswerNoBean answer);//存入站内消息表
    public int findDynamic(int aaid);//判断动态表是否存在这个回答
    public int addDynamic(int aaid,int uid);//将问题存入动态表;

    public int adminInitAnswer(AnswerNoBean answer);//审核表回答进入回答表(删除审核表回答方法上面有)
    public int updateUserData(int uid);//给用户表的回答数+1

    public int adminAnswerNo(AnswerNoBean answer);//管理员修改审核表




    //审核通过给用户发送邮箱问题提醒=========================================================================================
    public void setemailanswer(Integer uid,Integer state,String title)throws MessagingException;
    public void setemailanswerno(Integer uid,Integer state,String title)throws MessagingException;
}
